package com.netease.k;

import android.os.FileObserver;
import com.netease.c.o;
import com.netease.pris.a.f;
import java.io.File;
import java.util.concurrent.atomic.AtomicLong;

public class e extends FileObserver
{
  private static final boolean c = false;
  private static final String d = "FileSizeObserver";
  private static final int e = 4040;
  private static final int f = 345600000;
  private static final int g = 3600000;
  private static final int h = 15000;
  private static final int i = 25;
  private static final int j = 13;
  a a;
  b b;
  private String k;
  private long l;
  private AtomicLong m;
  private boolean n;
  private long o;
  private boolean p;

  public e(String paramString, long paramLong1, boolean paramBoolean, long paramLong2, a parama)
  {
    super(paramString, 4040);
    this.k = paramString;
    this.l = paramLong1;
    this.o = paramLong2;
    this.p = paramBoolean;
    this.a = parama;
    File localFile = new File(paramString);
    this.m = new AtomicLong(0L);
    if (localFile.exists())
      o.a(localFile, localFile.list(), this);
  }

  private void a(b paramb)
  {
    File localFile = new File(this.k);
    String[] arrayOfString = localFile.list();
    this.m.set(0L);
    o.a(localFile, arrayOfString, this);
    if (this.b == paramb)
      this.b = null;
  }

  private void f()
  {
  }

  private void g()
  {
    if ((this.p) && (this.m.get() >= this.l) && (!c()))
      d();
  }

  private void h()
  {
    if ((this.o > 0L) && (this.m.get() >= this.o) && (this.a != null))
      this.o = this.a.a(this.k, this.m.get(), this.o);
  }

  public void a()
  {
    this.m.set(0L);
    com.netease.pris.b.a.a(this.k, 0L);
  }

  public void a(int paramInt, long paramLong)
  {
    this.m.addAndGet(paramLong);
    g();
    h();
    f();
  }

  public void a(long paramLong)
  {
    this.o = paramLong;
  }

  public void a(long paramLong, boolean paramBoolean)
  {
    if ((!this.n) && (this.p))
    {
      if (c())
        e();
      this.b = new b(this, paramLong, paramBoolean);
      Thread localThread = new Thread(this.b);
      localThread.setPriority(1);
      localThread.start();
    }
  }

  public void a(File paramFile)
  {
    if (paramFile.exists())
    {
      this.m.addAndGet(paramFile.length());
      g();
      f();
      h();
    }
  }

  public void a(String paramString)
  {
    b(new File(this.k, paramString));
  }

  public void a(boolean paramBoolean)
  {
    this.n = paramBoolean;
    if ((paramBoolean) && (c()))
      e();
  }

  public boolean a(File paramFile1, File paramFile2)
  {
    if (paramFile1.exists())
      this.m.addAndGet(-paramFile1.length());
    for (boolean bool = paramFile1.renameTo(paramFile2); ; bool = false)
      return bool;
  }

  public long b()
  {
    long l1;
    if (new File(this.k).exists())
      l1 = this.m.get();
    while (true)
    {
      return l1;
      l1 = 0L;
    }
  }

  public boolean b(File paramFile)
  {
    boolean bool;
    if (paramFile.exists())
    {
      this.m.addAndGet(-paramFile.length());
      if (paramFile.isDirectory())
        bool = f.c(paramFile);
    }
    while (true)
    {
      return bool;
      bool = paramFile.delete();
      continue;
      bool = false;
    }
  }

  public void c(File paramFile)
  {
    this.m.addAndGet(-paramFile.length());
  }

  public boolean c()
  {
    if (this.b != null);
    for (int i1 = 1; ; i1 = 0)
      return i1;
  }

  public void d()
  {
    a(345600000L, false);
  }

  public void e()
  {
    b localb = this.b;
    if (localb != null)
      localb.a();
  }

  public void onEvent(int paramInt, String paramString)
  {
  }
}

/* Location:           D:\android\hack\dex2jar-0.0.9.8\classes_dex2jar.jar
 * Qualified Name:     com.netease.k.e
 * JD-Core Version:    0.6.0
 */